import { Button, Form } from 'antd';

const Search = (props) => {
  const [form] = Form.useForm();
  const reset = () => {
    form.resetFields()
    props?.reset && props?.reset()
  }
  return (
    <Form form={form} name="horizontal_login" layout="inline">
      {
        props.children
      }
      <Form.Item>
        <Button type="primary" onClick={() => props.submit(form)}>
          搜索
        </Button>
        <Button style={{marginLeft: '5px'}} onClick={reset}>
          重置
        </Button>
      </Form.Item>
    </Form>
  );
};

export default Search;